package WeekTest01;

public class SumDigits {

	public static void main(String[] args) {
		System.out.println(sumDigits(12345));
	}
	public static int sumDigits(long n) {
		int a = 0;  
		while (n != 0) {
	          a+=(n % 10);
	          n = n / 10;
	        }
		  return a;
	}
}
